import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import ElementPlus from 'unplugin-element-plus/vite'
import Unocss from "unocss/vite"
// https://vite.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      '@': '/src'
    }
  },
  plugins: [vue(), Unocss(),
  AutoImport({
    //全局自动导入
    imports: ['vue',"vue-router","pinia"],
    resolvers: [ElementPlusResolver()],
    //给eslint生成的配置 只需要生成一次
    eslintrc: {
      enabled: false
    }
  }),
  Components({
    //解析组件
    resolvers: [ElementPlusResolver()],
    // 自动加载组件
    dirs: ['src/components',"src/layout/components"],
  }),
  ElementPlus({}) //导入样式 不需要引入
  ],
});
